package com.cy.controller;

import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.apache.shiro.authz.annotation.RequiresUser;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author wxhn1
 */
@Controller
@RequestMapping("a")
@CrossOrigin
public class AController {

    @RequiresUser
    @RequestMapping("find")
    public String a(Model m){
        m.addAttribute("msg","查询A");
        return "index";
    }

    @RequiresUser
    @RequiresRoles(value = {"组长","经理"},logical = Logical.OR)
    @RequestMapping("del")
    public String a1(Model m){
        m.addAttribute("msg","删除A");
        return "index";
    }

}
